<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <title>我的合约</title>
    <link rel="stylesheet" href="../../css/reset.css">
    <style>
        body {
            width: 100%;
            background-color: #F8F8F8;
            font-size: 0.28rem;
            height: auto;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            font-family: PingFangSC-Regular, sans-serif;
            color: #333333;
            padding: 0 0.3rem;
            box-sizing: border-box;
        }

        .showCoinAbout {
            width: 100%;
            height: 2.48rem;
            background: url("../../image/bgnewsad.png") no-repeat;
            background-size: 100% 100%;
            border-radius: 0.1rem;
            margin: 0.2rem 0;
            overflow: hidden;
        }

        .showCoinAboutUp {
            width: 100%;
            height: 2.48rem;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            padding: 0.26rem 0 0.3rem 0;
            box-sizing: border-box;
        }

        .showCoinAboutUp>p {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 0.26rem;
            font-family: PingFang SC;
            font-weight: 400;
            color: rgba(48, 20, 5, 0.6);
        }

        .showCoinAboutUp>p>span:last-of-type {
            font-size: 0.3rem;
            margin-top: 0.06rem;
        }

        .showCoinAboutUp div {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: flex-start;
            justify-content: center;
        }

        .showCoinAboutUp div>p {
            width: 50%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
        }

        .showCoinAboutUp div>p>span:not(:first-of-type) {
            margin-top: 0.1rem;
        }

        .operationOrder {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-end;
            font-size: 0.24rem;
            color: #262626;
            margin: 0.23rem 0;
        }

        .operationOrder p {
            position: relative;
        }

        .operationOrder p:last-of-type {
            position: relative;
            margin-left: 0.7rem;
        }

        .operationOrder p img {
            height: 0.26rem;
        }

        .contractList {
            width: 100%;
            height: auto;
        }

        .golistPage {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
        }

        .golistPage li {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            background-color: #fff;
            border-radius: 0.1rem;
            overflow: hidden;
            padding: 0.26rem 0;
            margin-bottom: 0.2rem;
        }

        .golistPage li p {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: stretch;
            justify-content: space-between;
            padding: 0 0.28rem 0 0.2rem;
            box-sizing: border-box;
            margin-top: 0.09rem;
        }

        .golistPage>li>p span {
            font-size: 0.24rem;
            color: rgba(38, 38, 38, 1);
        }

        .golistPage>li:not(:first-of-type)>p:last-of-type {
            border-top: 1px solid rgba(237, 237, 237, 1);
            padding-top: 0.16rem;
            margin-top: 0.16rem;
        }

        .firstspan {
            font-size: 0.24rem;
            color: #999999;
        }

        .putongBtc {
            width: 0.3rem;
            margin-right: 0.08rem;
        }

        .firstp {
            margin-bottom: 0.1rem;
        }

        .firstp b {
            display: flex;
            align-items: center;
        }

        .btcAbout {
            width: 100%;
            margin-top: 0.2rem;
            border-top: 1px solid rgba(237, 237, 237, 1);
        }

        .btcAbout ul {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0.28rem 0 0.2rem;
            box-sizing: border-box;
        }

        .btcAbout ul li {
            width: auto;
            align-items: center;
            margin-bottom: 0;
            padding: 0.26rem 0 0 0;
            font-size: 0.24rem;
        }

        .btcAbout ul li p {
            color: rgba(153, 153, 153, 1);
            letter-spacing: 0.02rem;
            padding: 0;
        }

        .openhide {
            width: 6.6rem;
            height: 0.98rem;
            background: rgba(248, 248, 248, 1);
            opacity: 1;
            border-radius: 0.14rem;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            justify-content: center;
            align-items: flex-start;
            margin-left: calc((100% - 6.6rem) / 2);
            margin-top: 0.09rem;
            margin-bottom: 0.18rem;
            font-size: 0.24rem;
            color: #999999;
        }

        .golistPage li .openhide p {
            padding: 0 0.2rem 0 0.2rem;
            margin-top: 0;
        }

        .traginle {
            display: inline-block;
            width: 0;
            height: 0;
            border-left: 0.08rem solid transparent;
            border-right: 0.08rem solid transparent;
            border-top: 0.08rem solid #262626;
            position: absolute;
            right: 0.2rem;
            bottom: 0.14rem;
        }

        .transform {
            transform: rotate(180deg);
            -webkit-transform: rotate(180deg);
        }

        #showRenew {
            width: 0.39rem;
            height: 0.39rem;
            border-radius: 0.2rem 0.2rem 0.2rem 0;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            top: -0.2rem;
            right: -0.5rem;
            font-size: 0.2rem;
            background: linear-gradient(90deg, rgba(255, 105, 92, 1), rgba(242, 79, 65, 1));
            color: #ffffff;
        }
    </style>
</head>

<body>
    <div class="showCoinAbout">
        <div class="showCoinAboutUp">
            <p>
                <span>
                    累计收益(BTC)
                </span>
                <span class="incomeNum" style="font-size:0.4rem;color:#301405;">
                    0.00T
                </span>
            </p>
            <div>
                <p style="padding-right: 0.3rem;box-sizing: border-box;">
                    <span
                        style="display: flex;display: -webkit-flex;align-items: center;color:rgba(48,20,5,0.6);font-size:0.24rem;"
                        class="shownewDailog">
                        有效算龄 <img src="../../image/iconabx.png" id="mycolcPower"
                            style="width: 0.4rem;height: 0.4rem;margin-left: 0.1rem;">
                    </span>
                    <span class="numPower" style="font-size: 0.26rem;font-weight: 600;">
                        0.00T*天
                    </span>
                </p>
                <p style="padding-left: 0.3rem; box-sizing: border-box;">
                    <span style="color:rgba(48,20,5,0.6);font-size:0.24rem;">
                        历史最高算龄
                    </span>
                    <span class="histroyMax" style="font-size: 0.26rem;font-weight: 600;">
                        0.00T*天
                    </span>
                </p>
            </div>
        </div>
    </div>
    <div class="operationOrder">
        <p class="suanliChange">
            <img src="../../image/iconzhihuanx.png" alt="">
            <span>算力置换</span>
            <img src="../../image/hotnedwx.png" id="fixedImg"
                style="width: 0.34rem;height: 0.2rem;position: absolute;right: -0.34rem;top:-0.1rem;">
        </p>
        <p class="plxd">
            <img src="../../image/iconpiliang.png" alt="">
            <span>
                批量续单
            </span>
        </p>
    </div>
    <div class="contractList">
        <ul class="golistPage">
            <li data-type="classic_btc" data-name="经典BTC算力">
                <p class="firstp">
                    <b style="position: relative;">
                        <img src="../../image/ffdfhdh.png" class="putongBtc">
                        <span style="font-size: 0.28rem;">经典BTC算力</span>
                        <b id="showRenew" style="display: none;">
                            续
                        </b>
                    </b>
                    <span style="font-size: 0.22rem;">
                        查看合约包 <img src="../../image/right.png" style="width: 0.1rem;">
                    </span>
                </p>
                <p>
                    <span class="firstspan">
                        BTC总算力
                    </span>
                    <span class="btcTotal">
                        --T
                    </span>
                </p>
                <p>
                    <span class="firstspan">
                        累计收益(BTC)
                    </span>
                    <span class="btcIncome">
                        --
                    </span>
                </p>
                <div class="btcAbout">
                    <ul>
                        <li>
                            <b class="btcBasePower">
                                --T
                            </b>
                            <p>
                                基础算力
                            </p>
                        </li>
                        <li>
                            <b class="couputionPower">
                                --T
                            </b>
                            <p>
                                奖励总算力
                            </p>
                        </li>
                        <li>
                            <b class="baseBhpPower">
                                --T
                            </b>
                            <p>
                                BHP参配算力
                            </p>
                        </li>
                    </ul>
                </div>
            </li>
            <li data-type="lower_btc" data-name="高波BTC算力">
                <p class="firstp">
                    <b>
                        <img src="../../image/lowerfengxian.png" class="putongBtc"> <span
                            style="font-size: 0.28rem;">高波BTC算力</span>
                    </b>
                    <span style="font-size: 0.22rem;">
                        查看合约包 <img src="../../image/right.png" style="width: 0.1rem;">
                    </span>
                </p>
                <p>
                    <span class="firstspan">
                        BTC总算力
                    </span>
                    <span class="gbBasepower">
                        --T
                    </span>
                </p>
                <p>
                    <span class="firstspan">
                        累计收益(BTC)
                    </span>
                    <span class="gbInconNum">
                        --
                    </span>
                </p>
                <p>
                    <span class="firstspan">
                        BHP参配算力
                    </span>
                    <span class="gbBhpPower">
                        --T
                    </span>
                </p>
            </li>
            <li data-type="ipfs_machine" data-name="IPFS">
                <p class="firstp">
                    <b>
                        <img src="../../image/sasukl.png" class="putongBtc"> <span
                            style="font-size: 0.28rem;">IPFS</span>
                    </b>
                    <span style="font-size: 0.22rem;">
                        查看合约包 <img src="../../image/right.png" style="width: 0.1rem;">
                    </span>
                </p>
                <p style="position: relative;padding-right: 0.4rem;">
                    <span class="firstspan">
                        IPFS总存力
                    </span>
                    <span class="ipfs1 showBlancePower">
                        --TB
                    </span>
                    <span class="traginle showBlancePower">

                    </span>
                </p>
                <div class="openhide" style="display: none;">
                    <p>
                        <span class="firstspan">
                            封存进度:
                        </span>
                        <span class="ipfsclock">
                            --TB
                        </span>
                    </p>
                    <p>
                        <span class="firstspan">
                            昨日封存:
                        </span>
                        <span class="todayclock">
                            --TB
                        </span>
                    </p>
                </div>
                <p>
                    <span class="firstspan">
                        累计收益(FIL)
                    </span>
                    <span class="ipfsTotal">
                        --
                    </span>
                </p>
                <p>
                    <span class="firstspan">
                        累计收益(BTC)
                    </span>
                    <span class="ipfsBtcIncone">
                        --
                    </span>
                </p>
                <p>
                    <span class="firstspan">
                        赠送BTC算力
                    </span>
                    <span class="ipfs3">
                        --
                    </span>
                </p>
            </li>
        </ul>
    </div>
</body>
<script src="../../script/autosize.js"></script>
<script src="../../script/fastclick.js"></script>
<script src="../../script/jquery_three_two_one.js"></script>
<script src="../../script/app.js"></script>
<script>
    apiready = function () {
        var app = new APP();
        var account = app.getAccount();
        var mydaysCalc = 0;//我的算龄
        var isHaveMachine = 0;//是否有Ipfs置换矿机  0 就是没库存.
        var isRenewNum = api.pageParam.isHaveRenew;//是否有需要续单的机器 
        if (Number(isRenewNum) > 0) {
            $("#showRenew").show();
        } else {
            $("#showRenew").hide();
        }
        //获取算龄基础算力
        function getData() {
            app.ajaxPro({
                url: "member/get-my-power",
                values: {
                    token: account.token
                },
                openFlower: true
            }, function (ret) {
                if (ret.code == 200) {
                    isHaveMachine = ret.data.ventroy;
                    mydaysCalc = ret.data.powerTimeNow;
                    $(".numPower").text(
                        ret.data.powerTimeNow == 0 ? "0.00 T*天" : ret.data.powerTimeNow + " T*天"
                    );
                    if (Number(ret.data.powerTimeNow) >= 1000) {
                        $("#mycolcPower").attr("src", "../../image/iconadfx.png")
                    };
                    $(".histroyMax").text((Number(ret.data.powerTimeYesterdayMax) > Number(ret.data.powerTimeNow) ? ret.data.powerTimeYesterdayMax : ret.data.powerTimeNow) + " T*天");
                    $(".incomeNum").text(ret.data.totalRevenue);
                    //BTC
                    $(".btcTotal").text(ret.data.btc.totalPower + "T");
                    $(".btcIncome").text(ret.data.btc.revenue);
                    $(".btcBasePower").text(ret.data.btc.basePower + "T");
                    $(".couputionPower").text(ret.data.btc.rewardPower + "T");
                    $(".baseBhpPower").text(ret.data.btc.bhpPower + "T");
                    //高波
                    $(".gbBasepower").text(ret.data.gb.totalPower + "T");
                    $(".gbInconNum").text(ret.data.gb.revenue);
                    $(".gbBhpPower").text((ret.data.gb.bhpPower || "0") + "T");
                    //IPFS
                    $(".ipfs1").text(ret.data.ipfs.totalPower + "TB");
                    $(".ipfsclock").text(ret.data.ipfs.total_power_stored + "TB");
                    $(".todayclock").text(ret.data.ipfs.total_yday_stored + "TB");
                    $(".ipfsTotal").text(ret.data.ipfs.fil);
                    $(".ipfsBtcIncone").text(ret.data.ipfs.btc);
                    $(".ipfs3").text(ret.data.ipfs.btcPower + "T");
                }
            });
        }
        getData();
        $(".shownewDailog").on("click", function () {
            if (mydaysCalc >= 1000) {
                var param = {
                    dtype: "dialog44",
                    data: mydaysCalc
                };
            } else {
                var param = {
                    dtype: "dialog45",
                    data: mydaysCalc
                };
            }
            app.dialog(param);
        })
        $(".suanliChange").click(function (e) {
            e.stopPropagation();
            if (isHaveMachine == 0) {
                var param = {
                    dtype: "dialog86"
                };
                app.dialog(param);
                return
            }
            var cointypecontract = {
                name: "changeIpfs",
                subpage: "rent/change_ipfs",
                title: "算力置换",
                rightTitle: "记录",
                param: {
                    pageName: "changeIpfs",
                    allowEdit: true,
                    rightParam: {
                        name: "changeIpfsRecord",
                        subpage: "my/reandchare",
                        title: "置换记录",
                        param: {
                            pageName: "reandchare"
                        }
                    }
                }
            }
            app.setNavBarAttr(cointypecontract);
        });
        $(".plxd").click(function (e) {
            e.stopPropagation();
            var goCerfition = {
                name: "piliangxudan",
                subpage: "mine/piliangxudan",
                title: "批量续单",
                param: {
                    pageName: "piliangxudan",
                }
            };
            app.setNavBarAttr(goCerfition);
        })
        $(".golistPage>li").click(function () {
            var thisType = $(this).attr("data-type");
            if (thisType == "ipfs_machine") {
                app.ajaxPro({
                    url: "ipfs/contract",
                    values: {
                        token: account.token
                    },
                    openFlower: true
                }, function (ret) {
                    if (ret.code == 200) {
                        app.openWin({
                            name: "ipfsWin",
                            url: ret.data.url,
                            slidBackEnabled: false
                        })
                    }
                });
                return
            }
            var cointypecontract = {
                name: thisType,
                subpage: "rent/" + thisType,
                title: $(this).attr("data-name"),
                param: {
                    pageName: thisType
                }
            }
            app.setNavBarAttr(cointypecontract);
        })
        $(".showBlancePower").click(function (e) {
            e.stopPropagation();
            $(".openhide").slideToggle(100);
            $(".traginle").toggleClass('transform');
        })
        app.downRefresh(function () {
            getData();
        });
        app.listen('viewappear', function () {
            getData();
        });
        app.headerMap();
    }
</script>

</html>